package com.princess.demok.ui.adapter

import android.annotation.SuppressLint
import android.net.wifi.ScanResult
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.princess.demok.R
import kotlinx.android.synthetic.main.dialog_btmlist.view.tvShowBtmlist


/**
 *底部列表适配器
 */
class WifiListAdapter :
    BaseQuickAdapter<ScanResult, BaseViewHolder>(R.layout.item_wifilist) {

    var bssid = ""

    @SuppressLint("SetTextI18n")
    override fun convert(holder: BaseViewHolder, item: ScanResult) {
        holder.itemView.tvShowBtmlist.text = item.toString()
        val ssidItem = item.BSSID
        if (ssidItem==bssid) {
            holder.itemView.tvShowBtmlist.setTextColor(context.getColor(R.color.color_red))
        } else {
            holder.itemView.tvShowBtmlist.setTextColor(context.getColor(R.color.black8))
        }
    }
}